import request from '@/utils/request'

// 根据课程id查询该课程下所有章节及下面的小节
export const getAllChapterVideo = courseId => {
  return request({
    url: `/eduservice/chapter/getChapterVideo/${courseId}`,
    method: 'GET'
  })
}

// 添加课程章节
export const addChapter = chapter => {
  return request({
    url: '/eduservice/chapter/addChapter',
    method: 'POST',
    data: chapter
  })
}

// 根据id查询章节
export const getChapterById = id => {
  return request({
    url: `/eduservice/chapter/getChapter/${id}`,
    method: 'GET'
  })
}

// 修改课程章节
export const updateChapter = chapter => {
  return request({
    url: '/eduservice/chapter/updateChapter',
    method: 'POST',
    data: chapter
  })
}
